package com.tyj.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tyj.common.to.mq.SeckillOrderTo;
import com.tyj.common.utils.PageUtils;
import com.tyj.gulimall.order.entity.OrderEntity;
import com.tyj.gulimall.order.vo.confirmVo.OrderConfirmVo;
import com.tyj.gulimall.order.vo.confirmVo.OrderSubmitVo;
import com.tyj.gulimall.order.vo.confirmVo.SubmitOrderResponseVo;
import com.tyj.gulimall.order.vo.payVo.PayAsyncVo;
import com.tyj.gulimall.order.vo.payVo.PayVo;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author tanyoujie
 * @email 983629093@qq.com
 * @date 2021-02-09 22:37:19
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    SubmitOrderResponseVo submitOrder(OrderSubmitVo submitVo);

    void closeOrder(OrderEntity orderEntity);

    OrderEntity getOrderByOrderSn(String orderSn);

    PayVo getOrderPayInfo(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    String handlePayResult(PayAsyncVo vo);

    /**
     * 创建秒杀服务订单
     * @param orderTo
     */
    void createSeckillOrder(SeckillOrderTo orderTo);
}

